#ifndef __SUBJECT_H__
#define __SUBJECT_H__

#include <string>
#include <list>

class Observer;

class Subject
{
protected:
    std::string state;
public:
    virtual void Attach(Observer *observer) = 0;
    virtual void Detach(Observer *observer) = 0;
    virtual void Notify() = 0;
    void SetState(const std::string &state) {this->state = state;}
    std::string GetState() {return state;}
};

class Boss: public Subject
{
    std::list<Observer *> observers;
public:
    void Attach(Observer *observer) override;
    void Detach(Observer *observer) override;
    void Notify() override;
};

#endif